package com.test.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.test.pojo.User;
import com.test.service.UserService;

/**
 * 
 * @author 席恒昌
 * @Date 2017年3月28日
 *
 */

@RestController
@RequestMapping("/user")
public class UserController {

	@Autowired 
	UserService userservice;

	@RequestMapping("/{id}")
	public User view(@PathVariable("id") Integer id) {
		return userservice.getUserById(id);
	}

}
